package com.guoxin.thread.daemon;

public class DaemonThread {

    public static void main(String[] args) {
        Thread thread = new Thread(() -> {
            for (int i = 0; i < 100; i++) {
                System.out.println("我是子线程，" + i);
            }
        });
        thread.setDaemon(true);
        thread.start();
        for (int i = 0; i < 20; i++) {
            System.out.println("我是主线程，" + i);
        }
        System.out.println("主线程结束");
    }
}
